//
//  ShopingBagCollectionViewCell.m
//  Beauty
//
//  Created by Snow on 16/9/6.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "ShopingBagCollectionViewCell.h"
#import "GXMacro.h"
@implementation ShopingBagCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = [UIColor colorWithWhite:0.952 alpha:1.000];
        _image = [[UIImageView alloc] init];
        [self.contentView addSubview:_image];
        _labelOfCount = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfCount];
        _labelOfPrice = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfPrice];
        _labelOfHuge = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfHuge];
        _labelOfDetail = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfDetail];
        _buttonOfBuy = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:_buttonOfBuy];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    [_buttonOfBuy mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left).mas_equalTo(10);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(20);
    }];
    [_image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_buttonOfBuy.mas_right).mas_equalTo(10);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.height.mas_equalTo(60);
        make.width.mas_equalTo(60);
    }];
    [_labelOfPrice mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_image.mas_right).mas_equalTo(10);
        make.top.mas_equalTo(_image.mas_top);
        make.height.mas_equalTo(20);
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-100);
    }];
    [_labelOfDetail mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_labelOfPrice);
        make.right.mas_equalTo(self.contentView.mas_right);
        make.height.mas_equalTo(20);
        make.top.mas_equalTo(_labelOfPrice.mas_bottom);
    }];
    [_labelOfHuge mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_labelOfPrice.mas_left);
        make.top.mas_equalTo(_labelOfDetail.mas_bottom);
        make.right.mas_equalTo(_labelOfDetail.mas_right);
        make.height.mas_equalTo(20);
    }];
    [_labelOfCount mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-10);
        make.top.mas_equalTo(_labelOfPrice.mas_top);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(20);
    }];
    _labelOfCount.font = [UIFont systemFontOfSize:12];
    _labelOfDetail.font = [UIFont systemFontOfSize:15];
    _labelOfHuge.font = [UIFont systemFontOfSize:15];
}
@end
